package com.nwpu.server.learning.service.impl;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.nwpu.server.common.exception.BizCodeEnum;
import com.nwpu.server.common.util.ErrorUtils;
import com.nwpu.server.common.util.FormatUtils;
import com.nwpu.server.common.util.file.FileTypeUtils;
import com.nwpu.server.common.util.file.FileUtils;
import com.nwpu.server.learning.entity.ArticleEntity;
import com.nwpu.server.learning.entity.dto.AlgorithmTaskDTO;
import com.nwpu.server.learning.enums.StatusEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.AmqpException;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;

import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nwpu.server.common.response.*;

import com.nwpu.server.learning.dao.TaskDao;
import com.nwpu.server.learning.entity.TaskEntity;
import com.nwpu.server.learning.service.TaskService;
import org.springframework.web.multipart.MultipartFile;

@Service("taskService")
@Slf4j
public class TaskServiceImpl extends ServiceImpl<TaskDao, TaskEntity> implements TaskService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TaskEntity> page = this.page(
                new Query<TaskEntity>().getPage(params),
                new QueryWrapper<TaskEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public void run(JSONObject jsonObject) {

    }
}